#include <iostream>
#include <future>
#include <thread>
void Add(int x, int y, std::promise<int>& pro) {
    std::cout << "add\n";
    pro.set_value(x + y);
    return;
}
int main()
{
    std::promise<int> pro;
    std::future<int> fu = pro.get_future();
    std::thread th(Add, 11, 12, std::ref(pro));
    std::cout << fu.get() << std::endl;
    if(th.joinable()) th.join();
    return 0;
}